package com.cscec5b.inspection.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import java.util.List;

public class UserSyncDtos {
    public static class UserItem {
        @NotBlank @Size(max=64) public String user_code;
        @NotBlank @Size(max=64) public String username;
        @NotBlank @Size(max=256) public String password;      // 对端传来的双MD5/Base64串
        @Size(max=128) public String company_name;
        @NotBlank @Pattern(regexp="0|1") public String is_update;
    }
    public static class UserSyncRequest {
        @NotNull @Size(min=1) @Valid public List<UserItem> data;
    }
    public static class UserDetail {
        public String user_code;
        public boolean is_success;
        public String error;
        public UserDetail(String code, boolean ok, String err) {
            this.user_code = code; this.is_success = ok; this.error = err;
        }
    }
    public static class UserSyncResponse {
        public String code = "200";
        public String msg = "请求成功";
        public List<UserDetail> detail;
        public UserSyncResponse(List<UserDetail> d) { this.detail = d; }
    }
}
